<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/order/replenishmentlist/ReplenishmentList.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/order/replenishmentlist/ReplenishmentList.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '补料单',
                name: 'replenishmentlist/ReplenishmentList',
                url: "/ReplenishmentList/",
                sortName: "CreateDate",
                foreignKey:"ReplenishmentListId"
            });
            const editFormFields = ref({"BatchingNo":"","OrderNumber":"","BatchNumber":"","SteelWeight":"","HeatNo":"","PlannedReplenishmentQuantity":"","ActualReplenishmentAmount":"","ReplenishmentTime":"","CompletionTime":"","Enable":""});
            const editFormOptions = ref([[{"title":"物料编号","field":"BatchingNo"},
                               {"title":"订单号（计划单号）","field":"OrderNumber"},
                               {"title":"批次号","field":"BatchNumber"}],
                              [{"title":"钢水重量","field":"SteelWeight","type":"decimal"},
                               {"title":"炉号","field":"HeatNo"},
                               {"title":"计划补料量","field":"PlannedReplenishmentQuantity","type":"decimal"}],
                              [{"title":"实际补料量","field":"ActualReplenishmentAmount","type":"decimal"},
                               {"title":"补料时间（请求送料时间）","field":"ReplenishmentTime","type":"datetime"},
                               {"title":"完成时间","field":"CompletionTime","type":"datetime"}],
                              [{"dataKey":"enable","data":[],"title":"是否启用","field":"Enable","type":"select"}]]);
            const searchFormFields = ref({"BatchingNo":"","OrderNumber":"","BatchNumber":""});
            const searchFormOptions = ref([[{"title":"物料编号","field":"BatchingNo"},{"title":"订单号（计划单号）","field":"OrderNumber"},{"title":"批次号","field":"BatchNumber"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'IFPDId',title:'生产数据Id',type:'string',width:110,hidden:true,align:'left'},
                       {field:'BatchingNo',title:'物料编号',type:'string',link:true,width:110,align:'left',sort:true},
                       {field:'OrderNumber',title:'订单号（计划单号）',type:'string',width:110,align:'left'},
                       {field:'BatchNumber',title:'批次号',type:'string',width:110,align:'left'},
                       {field:'SteelWeight',title:'钢水重量',type:'decimal',width:110,align:'left'},
                       {field:'HeatNo',title:'炉号',type:'string',width:110,align:'left'},
                       {field:'PlannedReplenishmentQuantity',title:'计划补料量',type:'decimal',width:110,align:'left'},
                       {field:'ActualReplenishmentAmount',title:'实际补料量',type:'decimal',width:110,align:'left'},
                       {field:'ReplenishmentTime',title:'补料时间（请求送料时间）',type:'datetime',width:150,align:'left',sort:true},
                       {field:'CompletionTime',title:'完成时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Enable',title:'是否启用',type:'int',bind:{ key:'enable',data:[]},width:110,align:'left'},
                       {field:'CreateUserName',title:'添加人',type:'string',width:110,align:'left'},
                       {field:'CreateUserId',title:'添加人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateDate',title:'添加时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyUserName',title:'修改人',type:'string',width:110,align:'left'},
                       {field:'ModifyUserId',title:'修改人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'DeletionFlag',title:'删除标识',type:'int',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "补料单明细",
                table: "ReplenishmentListDetails",
                columns: [{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ReplenishmentListId',title:'补料单号(id)',type:'string',width:110,hidden:true,align:'left'},
                       {field:'IngredientsType',title:'补料类型',type:'int',bind:{ key:'配料类型',data:[]},width:110,align:'left',sort:true},
                       {field:'MaterialId',title:'物料（产品）ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'MaterialName',title:'物料（产品）名称',type:'string',width:110,align:'left'},
                       {field:'Source',title:'1=立库；2=配料台；3、配料备料',type:'string',bind:{ key:'配料来源',data:[]},width:110,align:'left'},
                       {field:'BatchNumber',title:'批次号',type:'string',width:110,align:'left'},
                       {field:'RequiredWeight',title:'需求重量',type:'string',width:110,align:'left'},
                       {field:'ActualWeight',title:'投料重量（实际）',type:'string',width:110,align:'left'},
                       {field:'State',title:'状态',type:'int',width:110,align:'left'},
                       {field:'MaterialBoxNo',title:'料箱号',type:'string',width:110,hidden:true,align:'left'}],
                sortName: "IngredientsType",
                key: "Id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
